import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';

/// @author 高裕
/// 微信小程序工具
class WXAppletNativeUtil {
  static const _methodChannelName = 'flutter.keqiang.com/WXApplet';

  static const _platformMethod = MethodChannel(_methodChannelName);

  /// 跳转微信小程序
  static Future<void> jumpWxApplet(
      {required String id, required String path}) async {
    try {
      return await _platformMethod
          .invokeMethod('appletJump', {'id': id, 'path': path});
    } on PlatformException catch (e) {
      debugPrint(e.message);
    }
  }
}
